<?php

class sectionTask extends sfBaseTask
{
  protected function configure()
  {

    $this->addOptions(array(
      new sfCommandOption('name', null, sfCommandOption::PARAMETER_REQUIRED, 'The section name'),
    ));

    $this->namespace        = 'wixet';
    $this->name             = 'create-section';
    $this->briefDescription = 'Creates a new section';
    
  }

  protected function execute($arguments = array(), $options = array())
  {
    // initialize the database connection
    $databaseManager = new sfDatabaseManager($this->configuration);
    $section = new Section();
    $section->setName($options['name']);
    $section->save();
    
    $this->log("Section created");
  }
}
